//
//  ModifyCheckPayPasswordController.m
//  HuLaQuan
//
//  Created by hok on 1/21/16.
//  Copyright © 2016 Jianghao. All rights reserved.
//

#import "ModifyCheckPayPasswordController.h"

#import "ModifyPayPWFirstInputController.h"

@interface ModifyCheckPayPasswordController ()


@end

@implementation ModifyCheckPayPasswordController


-(NSString *)finish:(NSString *)pwd{
    NSLog(@"haha %@",pwd);
    
    [self.passwordAndInfos setObject:pwd forKey:@"checkpassword"];
    
    //[YuNetworkStatusUtilities showProgressMessage:NETWORK_LOADING];
    //  [self.modifyPayPWEngine verifyOldPayPassword:pwd];
    
    [self performSegueWithIdentifier:@"ShowModifyPayPasswordFromCheck" sender:self];
    return pwd;
}




- (void)confirmPayPasswordFinish
{
    
}

#pragma mark - Life Cycle
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
    
   // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(verifyPWForModifyPayPWFinish:) name:@"VerifyPWForModifyPayPWFinish" object:nil];
    
}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:YES];
   // [[NSNotificationCenter defaultCenter] removeObserver:self name:@"VerifyPWForModifyPayPWFinish" object:nil];
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Navigation


- (void)goBackAction
{
    UIAlertController *x = [UIAlertController alertWithTitle:@"提示" andMessage:@"是否放弃修改支付密码" andBlock:^(UIAlertAction *action ) {
        if ([action.title isEqualToString:@"好的"]) {
            [self.navigationController popToViewController:self.navigationController.viewControllers[1] animated:YES];
            [[UIApplication sharedApplication].keyWindow endEditing:YES];
        }
        
    }  type:@"confirmAndCancel"];
    [self presentViewController:x animated:YES completion:nil];
}
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
    if ([[segue identifier] isEqualToString:@"ShowModifyPayPasswordFromCheck"]) {
        ModifyPayPWFirstInputController *controller = (ModifyPayPWFirstInputController*) [segue destinationViewController];
        
        controller.type = PayPassword;
        controller.titleOfNav = kReSetPayPasswordTitle;
        controller.titleOfPassword = kReSetPayPasswordHint;
      //  controller.passwordAndInfos = self.passwordAndInfos;
    }
}

@end
